package atguigu;

import com.atguigu.aop.MathCaculator;
import com.atguigu.config.MainConfigOfAop;
import org.junit.Test;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author gcq
 * @Create 2020-09-25
 */
public class IOCTest_Aop {

    //1、使用命令行动态参数，在虚拟机参数位置加载 -Dspring.profiles.active=test
    //2、代码的方式激活某种环境
    //3
    @Test
    public void test01() {
        AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext(MainConfigOfAop.class);
        MathCaculator bean = applicationContext.getBean(MathCaculator.class);
        bean.div(1, 1);
    }
}